#include <iostream>

using namespace std;

enum 
{
    a = 1,
    b,
    c = 1,
};

class Shape
{
public:
    enum ShapeColor {Red, Green, Blue};
    virtual void draw(ShapeColor color = Red) const
    {
        cout << color << "Red" << endl;
    }
};

class Rectangle : public Shape
{
public:
    virtual void draw(ShapeColor color = Green) const
    {
        cout << color << "Green" << endl;
    }
};

class Circle : public Shape
{
public:
    virtual void draw(ShapeColor color) const
    {}
};

void test()
{
    Circle c;
    Shape &r = c;
    r.draw();

    //Circle &rc = c;
    /**
     *rc.draw();
     *c.draw();
    */
}

void test1()
{
    const Shape *s = new Rectangle();
    //函数调用Rectangle，缺省值是Shape的
    s->draw();
}

int main(int argc, char *argv[])
{
    test1();
    return 0;
}
